Release 10.1A: OpenEdge Getting Started:
Object-oriented Programming
Calling a super class method
You can invoke the super class definition of a method using the
SUPERsystem reference. Executing a super class method using theSUPERsystem reference within a subclass causes control to switch to the version of the method in the next higher super class that implements it, bypassing any classes that do not implement the method. TheSUPERsystem reference is normally used to invoke the super class behavior for a method from within the subclass override of that method, in order to construct a chain of behavior. However, it can also be used to invoke any other method in a super class. Therefore, the method name to invoke is part of the syntax.This is the syntax to call a super class version of a method using the
SUPERsystem reference:
Element descriptions for this syntax diagram follow:
return-variableThe variable to hold the value returned by the method. If the method is defined with a
VOIDreturn type, the method does not return a value and theSUPERsystem reference does not use thereturn-variableassignment.method-nameThe name of the method to call in the class hierarchy. The first method found, starting from the immediate super class of the current class and searching upward in the class hierarchy, is the method executed. It might be anywhere in the class hierarchy starting from the immediate super class.
The method invoked can be any method name valid in the class hierarchy. It does not need to match the method name from where the call is made.
[parameter[ ,parameter] ... ]The parameters of the method. For more information on the syntax of
parameter, see the “Parameter passing syntax” reference entry in OpenEdge Development: Progress 4GL Reference .From within a class, any invocation of an overridden method without the use of the
SUPERsystem reference invokes the bottom-most subclass's implementation of the method. From within a class, any invocation of an overridden method with the use of theSUPERsystem reference invokes the super class's implementation of the method. There is no direct access to the super class's implementation of the overridden method from outside the class.
|
Copyright © 2005 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |